Repository navigation
fix: scroll to the top when opening a feed on mobile - #317
Merged
Merged
Conversation
therealsama
force-pushed
the
fix/swipe-tab-opens-at-top
branch
from
November 1, 2026 18:58
a5f2255 to
4c46b64
Compare
therealsama
enabled auto-merge
November 1, 2026 19:23
On a phone, the story panels scroll the page itself, so the page keeps one scroll position for whatever is on screen. Tapping a feed tab (or the logo) mounts a new viewer, which shows its first story without touching that position: scroll down a Top story, tap Best, and the first Best story opens partway down its comments. The viewer now scrolls to the top when it opens without a story in the URL, which is how a tab, the logo, and a domain or user list open it. A viewer opened on a story (Back, a reload, a link) leaves the page alone, so its restore still sets the offset, and the story you left keeps its saved position for Back.
therealsama
force-pushed
the
fix/swipe-tab-opens-at-top
branch
from
November 1, 2026 19:27
4c46b64 to
c1ea2e0
Compare
kplachkov
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a phone, scrolling down a story and then tapping a feed tab or the logo opened the new feed's first story partway down, at the offset the previous story was scrolled to.
Cause
The swipe viewer's panels scroll the page itself. A tab or the logo mounts a new viewer, and nothing resets the page's position: the viewer finds its first story already on screen, and the header scrolls to the top only on the feed's own URL, which in swipe mode becomes
/item/<id>as soon as a story shows. Desktop isn't affected.Fix
SwipeStoryViewerCorescrolls to the top when it opens without a story in the URL: a feed tab, the logo, or a domain or user list. A viewer opened on a story (Back, a reload, a link) still restores its saved offset.